home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 13 April 1997
- // Author: gf
- //
- //
- // Procedure Name:
- // RenRenderMenu
- //
- // Description:
- // Create the RENDERING->Render menu
- //
- // Input Arguments:
- // parent to parent the menu to.
- //
- // Return Value:
- // None.
- //
-
- //
- // Description: Called when user opens the main render menu.
- // This procedure calls the render menu building UI specific to the current
- // renderer.
- // Returns: None
- //
- global proc RenRenderMenu( string $parent )
- {
- setParent -m $parent;
-
- if( `menu -q -ni $parent` != 0 ) {
- updateMayaRenderMenu($parent);
- return;
- }
-
- // Build the pulldown render menu.
- //
- mayaRenderMenu($parent);
-
- setParent -m $parent;
- menuItem -divider true;
-
- //....
- // Create submenu to allow for renderer selection
-
- menuItem
- -subMenu true
- -label "Render using"
- -annotation
- "Change current renderer"
- ("renMenuRenderUsingItemMenuItem");
-
- menuItem
- -edit
- -postMenuCommand
- ("buildRenderMenuRenderUsingSubmenu renMenuRenderUsingItemMenuItem")
- ("renMenuRenderUsingItemMenuItem");
- }
-
- // Description: Builds the "Render Using" submenu that allows the user to select
- // from the available renderers
- // Returns: None
- //
- global proc buildRenderMenuRenderUsingSubmenu(string $subMenuName)
- {
- popupMenu -e -deleteAllItems $subMenuName;
- setParent -m $subMenuName;
-
- string $renderers[] = `renderer -query -namesOfAvailableRenderers`;
- int $isCurrent = 0;
- string $funcName = "";
- string $rendererUIName = "";
-
- radioMenuItemCollection ("renderWindowRenderUsingCollection" + $subMenuName);
-
- for ($i = 0; $i < size($renderers); $i += 1)
- {
- if($renderers[$i] == currentRenderer())
- {
- $isCurrent = 1;
- }
- else
- {
- $isCurrent = 0;
- }
-
- $funcName = "setCurrentRenderer " + $renderers[$i];
- $rendererUIName = `renderer -query -rendererUIName $renderers[$i]`;
-
- menuItem -l $rendererUIName
- -radioButton $isCurrent
- -collection ("renderWindowRenderUsingCollection" + $subMenuName)
- -c $funcName
- ("renderUsingItemSubMenu" + $i);
- }
- }
-